include ../common.mk
LIB_NAME		= libsnet.so
SRC_HOME		= ../src
INCLUDE_HOME	= ../include

INC			= -I$(SRC_HOME)/ -I$(INCLUDE_HOME)/ 

LIB			= -lpthread

DEFINITIONS		= -D_DEBUG -DMAC_OS_X

CFLAGS			= -g ${INC} $(LIB_PATH) -c ${DEFINITIONS} -O3
LDFLAGS			= -r -o

vpath %   ${SRC_HOME} ${INCLUDE_HOME}

#
#	Setup Macro to Comile Source
#

OBJS = libsnet.o

all : ${LIB_NAME}

${LIB_NAME}: ${OBJS}
			 ${GCC} -shared -o $@ ${OBJS} ${LIB}
			 chmod +x $@
			 cp $@ ${DEVSIM_HOME}/bin/
			 mv $@ ${TARGET_DIR}/

.c.o :
			${GCC} ${CFLAGS} $<

clean :
	\rm -rf *.o ${TARGET_DIR}/* ${DEVSIM_HOME}/bin/${LIB_NAME}
